<template>
  <el-dialog
    :visible="visible"
    title="编辑详情"
    width="700px"
    @close="close"
  >
    <div class="dialog-content">
      <div
        v-for="(item, index) in data"
        :key="index"
        class="content-item"
      >{{ item }}</div>
    </div>

    <div
      slot="footer"
      class="dialog-footer">
      <el-button
        type="primary"
        @click="close">确定</el-button>
    </div>
  </el-dialog>
</template>

<script>

export default {
  // 编辑详情
  name: 'EditDetailDialog',

  components: {
  },

  props: {
    data: {
      type: Array,
      default: () => []
    },
    visible: {
      type: Boolean,
      required: true,
      default: false
    }
  },
  data() {
    return {}
  },
  methods: {
    /**
     * @description: 关闭
     * @return {*}
     */
    close() {
      this.$emit('update:visible', false)
    }
  }
}
</script>

<style lang="scss" scoped>
.dialog-content {
  min-height: 30vh;
  max-height: 50vh;
  overflow-y: auto;

  .content-item {
    line-height: 1.2;
  }

  .content-item + .content-item {
    margin-top: 8px;
  }
}
</style>

